<?php
$oUsers = UserHandler::getUsers();
$oUser = $oUsers[$_REQUEST['iUser']];
?>
<div id="layer_user_change" class="hidden" style="visibility: visible;">
<form action="index.php" method="post" name="form_user_change">
<input type="hidden" name="sAction" value="user-change">
<input type="hidden" name="sView" value="user-list">
<input type="hidden" name="iUser" value="<?php print $_REQUEST['iUser'] ?>">
<table class="boxborder" cellspacing="0">
	<tr>
		<td class="boxhandle" colspan="2"><?php print msg('Change user') ?></td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('Username') ?>:</td>
		<td class="fieldvalue"><input type="text" name="sUser" value="<?php print $oUser->sUser ?>"></td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('Password') ?>:</td>
		<td class="fieldvalue"><input type="password" name="sPass"></td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('Password again') ?>:</td>
		<td class="fieldvalue"><input type="password" name="sPassAgain"></td>
	</tr>
	<tr>
		<td class="boxbody" style="text-align: center;" colspan="2">
			<?php print msg('Leave the password fields empty if you<br>don\'t want to change the password.') ?>
		</td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('Full name') ?>:</td>
		<td class="fieldvalue"><input type="text" name="sFullname" value="<?php print $oUser->sFullname ?>" id="focus_user_change"></td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('E-mail') ?>:</td>
		<td class="fieldvalue"><input type="text" name="sEmail" value="<?php print $oUser->sEmail ?>"></td>
	</tr>
<?php
if ($oUsers[$_SESSION['rid']]->bAdmin)
{
	?>
	<tr>
		<td class="fieldname"><?php print msg('Admin') ?>:</td>
		<td class="fieldvalue"><input type="checkbox" name="bAdmin" value="1" <?php print ($oUser->bAdmin ? 'checked' : '') ?>></td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('Accountant') ?>:</td>
		<td class="fieldvalue"><input type="checkbox" name="bAccountant" value="1" <?php print ($oUser->bAccountant ? 'checked' : '') ?>></td>
	</tr>
	<?php
}
?>
	<tr>
		<td class="boxbody" style="text-align: center;" colspan="2">
			<input type="submit" value="<?php print msg('OK') ?>">
			<input type="button" value="<?php print msg('Cancel') ?>" onClick="layerHide('layer_user_change');">
		</td>
	</tr>
</table>
</form>
</div>
